//初始化数据
function tabbarinit() {
  return [
    {
      "current": 0,
      "pagePath": "/pages/index/index",
      "iconPath": "icon-home",
      "text": "主页"
    },
    {
      "current": 0,
      "pagePath": "/pages/category/category",
      "iconPath": "icon-list",
      "text": "列表"

    },
    {
      "current": 0,
      "pagePath": "/pages/cart/cart",
      "iconPath": "icon-shopcar",
      "text": "购物车"
    },
    {
      "current": 0,
      "pagePath": "/pages/user/user",
      // "pagePath": "/pages/shopAdd/shopAdd",
      "iconPath": "icon-acnt",
      "text": "我的"
    }
  ]

}
//tabbar 主入口
function tabbarmain(bindName = "tabdata", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = tabbarinit();
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

module.exports = {
  tabbar: tabbarmain
}
